<?php 
class Zend_View_Helper_JavascriptHelper extends Zend_View_Helper_Abstract {   
	/**
	 * This is method javascriptHelper
	 *
	 * @return mixed This is the return value description
	 *
	 */	
	function javascriptHelper($assets = array()) {
		if(!is_array($assets)) {
			if(isset($assets)) {
				$assets	= array($assets);
			} else {
				$assets	= array();
			}
		}		
		
		foreach($assets as $js) {
			if (0 !== stripos($js, 'http://') && 0 !== stripos($js, '/') && 
				0 !== stripos($js, './')) {
				$js = $this->view->baseUrl('/') . '/assets/js/' . $js;
			}
			
			//if (is_file($css)) { 
			$this->view->headScript()->appendFile($js); 
			//}			
		}		
		
		//$request = Zend_Controller_Front::getInstance()->getRequest();
		//$fileUri = $this->view->baseUrl('/') . '/assets/js/' . 
		//	$request->getControllerName() . '/' . $request->getActionName() . '.js';
		
		return $this->view->headScript(); 
	}
}
?>